let middlewares=[
    async (ctx,next)=>{
        console.log('Start 1');
        next();
        console.log('End 1');
    },
    async (ctx,next)=>{
        console.log('Start 2');
        next();
        console.log('End 2');
    }
];

(async ()=>{
    let fn=Promise.resolve(middlewares[0]);

    console.log(fn);
})();